package kr.ne.jay.SimpleString;

public class VerletPoint {
	public Vector2f		pos;
	public Vector2f		oldPos;
	
	public VerletPoint(Vector2f _pos, Vector2f _oldPos) {
		pos		= _pos;
		oldPos	= _oldPos;
	}
	
	public void verlet(float dt, final Vector2f g) {
		float dt2 = dt*dt;
		float drag = 0.99f;
		Vector2f old = new Vector2f(pos);
		Vector2f diff = pos.minus(oldPos);
		diff.mul(drag).acc(g.times(dt2));
		pos = pos.plus(diff);
		oldPos.set(old);
	}
}
